package org.freez4.spring.conversion;

import java.beans.PropertyEditor;
import java.util.logging.Logger;

/**
 * {@link PropertyEditor} 示例
 *
 * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
 * @see PropertyEditor
 * @since
 */
public class PropertyEditorDemo {

    private static final Logger logger = Logger.getLogger(PropertyEditorDemo.class.getName());

    public static void main(String[] args) {
        // 模拟 Spring Framework 操作
        String text = "name = 阿坤同学";
        PropertyEditor propertyEditor = new StringToPropertiesPropertyEditor();
        // 传递 String 类型的内容
        propertyEditor.setAsText(text);

        String format = String.format("propertyEditor#getValue():%s", propertyEditor.getValue());
        logger.info(format);
        logger.info(propertyEditor.getAsText());
    }
}